﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace DevelopTools.UI
{
    public class InputControl : MonoBehaviour
    {
        public float MouseX, MouseY;
        public bool isMouseDown, isMouseUp;
        public bool isClickMouseDown;
        public static InputControl instance;

        RaycastHit hit; Ray ray;
        public GameObject colliderObj;
        // Use this for initialization
        void Awake()
        {
            instance = this;
        }
        void Start()
        {

        }

        // Update is called once per frame
        void Update()
        {
            MouseX = Input.GetAxis("Mouse X");
            MouseY = Input.GetAxis("Mouse Y");
            isMouseDown = Input.GetMouseButton((int)MouseButton.MouseButton_Left);
            isClickMouseDown = Input.GetMouseButtonDown((int)MouseButton.MouseButton_Left);
            isMouseUp = Input.GetMouseButtonUp((int)MouseButton.MouseButton_Left);
            //if (isMouseDown)
            //{
            //    //StateControl.instance.mStateCarr = StateControl.StateCarr.normal;
            //    //StateControl.instance.SetTimeNow(10);
            //}
            //if(isClickMouseDown)
            //{
            //    //StateControl.instance.mStateCarr = StateControl.StateCarr.normal;
            //    //StateControl.instance.SetTimeNow(10);

            //}

            if (isMouseDown)
            {
                ray = Camera.main.ScreenPointToRay(Input.mousePosition);
                if (Physics.Raycast(ray, out hit, 1000))
                {
                    if (hit.transform.gameObject == colliderObj)
                    {
                        //StateControl.instance.mStateCarr = StateControl.StateCarr.rotObjByMouse;
                    }
                }
            }

        }
    }
}